package com.mx.zb.md.tenant.utils.db;

import javax.sql.DataSource;

import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 
 * @ClassName: DataSourceConfig
 * @Description: 手动初始化数据源
 * @author 张博
 * @date 2017年9月9日 下午3:12:09 
 *
 */
//@Configuration
public class DataSourceConfig {

    @Bean(name = "md_tenant_common")
    @ConfigurationProperties(prefix = "spring.datasource.md_tenant_common") // application.properteis中对应属性的前缀
    public DataSource dataSource1() {
        return DataSourceBuilder.create().build();
    }




    @Bean(name = "test")
    @ConfigurationProperties(prefix = "spring.datasource.test") // application.properteis中对应属性的前缀
    public DataSource dataSource2() {
        return DataSourceBuilder.create().build();
    }

}